﻿
function blink_CEtitle() {
    $('#CETitle').fadeIn(2000);
    $('#CETitle').fadeOut(100, 'swing', blink_CEtitle);
}

function blink_CEtag() {
    $('#CETag').fadeIn(5000);
    $('#CETag').fadeOut(3000, 'swing', blink_CEtag);
}

function menuProduct() {
    // $('#MenuProduct').hide();
    //dialog = $("#MenuProduct");

    //if ($(".MenuProduct").is(':visible')) {
    //    $(".MenuProduct").hide();
    //    $(".MenuProduct").css("visibility", "collapse");
    //}
    $("a.producMenu_link").click(function (event) {

        //Should not hide just after show 
        event.stopPropagation();

        //If visible hide the menu 
        if ($(".ProductMenu").is(':visible')) {
            $(".ProductMenu").hide();
            $(".ProductMenu").css("visibility", "collapse");
        }

        //if not visible show the menu 
        else {
            showMenu();
        }
    });

    //if click inside menu it should not close 
    $("div.ProductMenu").click(function (event) {
        event.stopPropagation();
    });


    //if click outside the menu it should close 
    $('body').click(function (e) {
        if ($(".ProductMenu").is(':visible')) {
            $(".ProductMenu").css("visibility", "collapse");
            $(".ProductMenu").hide();
        }
    });


    //if browser is resize then collaps the menu and refresh the page 
    $(window).resize(function () {
        if ($(".ProductMenu").is(':visible')) {
            $(".ProductMenu").css("visibility", "collapse");
            $(".ProductMenu").hide();
            location.reload(true);
        }
    });
   

    $('#A4').hover(function () {
        showMenu();
    });

    //================LOAD and Show PopUP Menu Start =============================== 


    function showMenu() {
        // this.dialog.css("top", link.position().top + link.height() + 50); 
        //alert("Yess");
        $('.ProductMenu').css("top", $(".producMenu_link").position().top + $(".producMenu_link").height() + 32);
        $('.ProductMenu').css("left", $(".producMenu_link").position().left + $(".producMenu_link").width() - $('.ProductMenu').width() + 20);
        $('.ProductMenu').css("position", "fixed");
        $('.ProductMenu').css("z-index", "1");
        $('.ProductMenu').css("visibility", "visible");
        //this.dialog.slideDown(0); 
        $('.ProductMenu').show();
    }

    //================LOAD and Show PopUP Menu End =============================== 
}

function menuWhatWeDo() {
    
    $("a.whatwedoMenu_link").click(function (event) {

        //Should not hide just after show 
        event.stopPropagation();

        //If visible hide the menu 
        if ($(".what-we-do-menu").is(':visible')) {
            $(".what-we-do-menu").hide();
            $(".what-we-do-menu").css("visibility", "collapse");
        }

            //if not visible show the menu 
        else {
            showMenu1();
        }
    });

    //if click inside menu it should not close 
    $("div.what-we-do-menu").click(function (event) {
        event.stopPropagation();
    });


    //if click outside the menu it should close 
    $('body').click(function (e) {
        if ($(".what-we-do-menu").is(':visible')) {
            $(".what-we-do-menu").css("visibility", "collapse");
            $(".what-we-do-menu").hide();
        }
    });


    //if browser is resize then collaps the menu and refresh the page 
    $(window).resize(function () {
        if ($(".what-we-do-menu").is(':visible')) {
            $(".what-we-do-menu").css("visibility", "collapse");
            $(".what-we-do-menu").hide();
            location.reload(true);
        }
    });


    $('#A2').click(function () {
        showMenu1();
    });

    //================LOAD and Show PopUP Menu Start =============================== 


    function showMenu1() {
        // this.dialog.css("top", link.position().top + link.height() + 50); 
        //alert("Yess");
        $('.what-we-do-menu').css("top", $(".producMenu_link").position().top + $(".producMenu_link").height() + 32);
        $('.what-we-do-menu').css("left", $(".producMenu_link").position().left + $(".producMenu_link").width() - $('.ProductMenu').width() + 20);
        $('.what-we-do-menu').css("position", "absolute");
        $('.what-we-do-menu').css("z-index", "1");
        $('.what-we-do-menu').css("visibility", "visible");
        //this.dialog.slideDown(0); 
        $('.what-we-do-menu').show();
    }

    //================LOAD and Show PopUP Menu End =============================== 
}